import { defineStore } from 'pinia'

export const useLayoutStore = defineStore('layout', {
  state: () => ({
    // 导航列表
    headList: [],
    // 是否显示侧边栏
    // bannerList: [],
    newList: [],
    isShowAside: true,
    hotList: [],
    // 是否显示头部
    isShowHeader: true,
  }),
  actions: {
    // 设置导航列表
    setHeadList(list) {
      this.headList = list
    },
    setBannerList(list) {
      this.bannerList = list
    },
    setNewList(list) {
      this.newList = list
    },
    setHotList(list) {
      this.hotList = list
    },
    // 切换侧边栏显示状态
    toggleAside() {
      this.isShowAside = !this.isShowAside
    },
    // 切换头部显示状态
    toggleHeader() {
      this.isShowHeader = !this.isShowHeader
    },
  },
})
